// components/my-order-item/my-order-item.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    ordered:{
      type:Boolean,
      value:false
    },
    ordering:{
      type:Boolean,
      value:false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    dialogShow: false,
    showOneButtonDialog: false,
    oneButton: [{ text: '确定' }]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    tapToOrderDetail(){
      let orderType = 'cancel';
      if(this.data.ordered){
        orderType = 'ordered';
      }
      else if(this.data.ordering){
        orderType = 'ordering';
      }
      wx.navigateTo({
        url: '../../pages/orderDetail/orderDetail?orderType='+orderType,
        success: (result) => {},
        fail: (res) => {},
        complete: (res) => {},
      })
    },
    openConfirm: function () {
      this.setData({
          dialogShow: true
      })
  },
  tapDialogButton(e) {
      this.setData({
          dialogShow: false,
          showOneButtonDialog: false
      })
  },
  tapOneDialogButton(e) {
      this.setData({
          showOneButtonDialog: true
      })
  }
  }
})
